﻿CREATE PROCEDURE [dbo].[friends_by_userId]
    @userId int
AS
SELECT
    Users.UserId,
    Users.Avatar AS User_Avatar,
    Users.Email AS User_Email,
    Users.Login AS User_Login

FROM [dbo].[Users]
    inner join Friends ON Users.UserId = Friends.FriendId
WHERE Friends.UserId = @userId

RETURN 0
